package com.wlsk.license.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 包车类型  plate 对应charter_type
 */
public enum CharterPlateTypeEnum implements BaseEnum<CharterPlateTypeEnum, String> {

    INTER_PROVINCIAL_CHARTER("20000947", "省际包车牌"),

    INTER_COUNTY_CHARTER("20000945", "县际包车牌"),

    INTRA_COUNTY_CHARTER("20000944", "县内包车牌");

    private final String code;

    private final String description;

    private static Map<String, CharterPlateTypeEnum> valueMap = new HashMap<>();

    CharterPlateTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    static {
        for (CharterPlateTypeEnum e : CharterPlateTypeEnum.values()) {
            valueMap.put(e.code, e);
        }
    }

    public static CharterPlateTypeEnum get(String value) {
        return valueMap.get(value);
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public CharterPlateTypeEnum getByCode(String code) {
        return valueMap.get(code);
    }
}
